package com.hdy.web.dao;

import com.hdy.web.pojo.LostObject;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LostObjectMapper {
    @Select("select * from lostobject_t;")
    List<LostObject> getAll()throws Exception;
    @Insert("insert into lostobject_t (lostname, lostposition, lostdescription, claimposition, lostdate, ` isreturned`)VALUES " +
            "(#{lostName}, #{lostPosition},#{lostDescription}, #{claimPosition}, now(), false ) ")
    @Options(useGeneratedKeys=true,keyProperty="lostObject.lostId",keyColumn = "lostId")
     int addObject(@Param("lostObject") LostObject lostObject,
            @Param("lostName") String lostName, @Param("lostPosition") String lostPosition,
            @Param("lostDescription") String lostDescription, @Param("claimPosition") String claimPosition);
}
